package com.tbit.manager.api;

import com.tbit.common.entity.view.Result;
import com.tbit.manager.api.dto.PackageDelayDTO;
import com.tbit.manager.api.dto.RideCardDTO;
import com.tbit.manager.api.dto.UserMemberDTO;
import com.tbit.manager.enums.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 免押套餐管理
 *
 * @author ：zhangtianyou
 * @since 2024/11/22
 */
@FeignClient(name = ApiConstants.NAME)
public interface RideCardApi {

    String PREFIX = ApiConstants.PREFIX + "/rideCard";

    /**
     * 用户购买的免押套餐记录分页
     *
     * @param userId     用户id
     * @param pageSize   条数
     * @param pageNumber 页码
     * @return Result<List < UserMemberDTO>>
     */
    @GetMapping(PREFIX + "/userRideCardPage")
    List<UserMemberDTO> userRideCardPage(@RequestParam("userId") Integer userId,
                                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                         @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber);

    /**
     * 延长骑行卡时间
     *
     * @param delayDTO     .
     * @return Result
     */
    @PostMapping(value = PREFIX + "/modifyExpireTime",consumes = "application/json",produces = "application/json")
    Result<String> modifyExpireTime(@RequestBody PackageDelayDTO delayDTO);

    /**
     * 修改用户骑行卡次数
     *
     * @param rideCardDTO .
     */
    @PostMapping(value = PREFIX + "/userRideCardEdit",consumes = "application/json",produces = "application/json")
    Result<String> userRideCardEdit(@RequestBody RideCardDTO rideCardDTO);
}
